﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Interviewer_SearchApplicant : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    private String ReturnDetailsApplicant() 
    {
        string Allapplicant ="";
        try
        {
            InterviewerMethord SA = new InterviewerMethord();
            DataTable tb = SA.ShowAllApplicant(txtApplicantName.Text) ;
            if(tb.Rows.Count>0)
            {
                foreach (DataRow item in tb.Rows)
                {
                    Allapplicant += "<tr><td class=\"style2\" style=\"width:180px\"><a href=\"DetailsApplicant.aspx?ID="+item["ApplicantID"].ToString()+"\">"+item["FullName"].ToString()+"</a>";
                    Allapplicant +="</td><td class=\"style2\" style=\"width:150px\">"+item["Address"].ToString();
                    Allapplicant += "</td><td class=\"style2\" style=\"width:130px\">" + item["Phone"].ToString();
                    Allapplicant += "</td><td class=\"style2\" style=\"width:100px\">" + item["BirthOfDate"].ToString().Substring(0, item["BirthOfDate"].ToString().IndexOf(" "));
                    Allapplicant += "</td><td class=\"style2\" style=\"width:126px\">" + item["EmailID"].ToString();
                    Allapplicant += "</td></tr>";
                    
                }
            }
        }
        catch (Exception ex)
        {

            Console.Write(ex.Message);
        }
        return Allapplicant;
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        LiteralApplicant.Text = ReturnDetailsApplicant();
    }
}